//
//  MZLoginVC.m
//  明和智能
//
//  Created by innofive on 2018/4/12.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "MZLoginVC.h"
#import "MZLoginCell.h"
#import "ViewController.h"
#import "MZRegisteredTableViewController.h"
@interface MZLoginVC ()

@end

@implementation MZLoginVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"登陆";
    
    self.view.backgroundColor = hexCOLOR(@"EBEBEB");
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
}
-(void)onClickButton:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
         
    [UIView transitionWithView:[UIApplication sharedApplication].keyWindow duration:1.f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
        BOOL oldState = [UIView areAnimationsEnabled];
        [UIView setAnimationsEnabled:NO];
        UIWindow *window = [UIViewController appWindow];
        ViewController *vc = [ViewController new];
        window.rootViewController = vc;
        [UIView setAnimationsEnabled:oldState];
    } completion:^(BOOL finished) {
        
    }];
            
        }
            break;
        case 200:
        {
            
        }
            break;
            
        default:
        {
            
            MZRegisteredTableViewController *vc = [MZRegisteredTableViewController new];
            vc.title = @"注册";
            [self pushToVC:vc];
            
        }
            break;
    }
}

//





- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

-(void)onSetSubviewSELForCell:(BaseTableViewCell *)cell forTableView:(UITableView *)tableView forIndexPath:(NSIndexPath *)indexPath
{
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
}

-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    if (indexPath.row==0) {
        return [MCCellInfo configForCellId:cell Class:[MZLoginCell0 class] Height:kFitH(15) TableView:tableView];
    }else if (indexPath.row==1) {
        return [MCCellInfo configForCellId:cell1 Class:[MZLoginCell class] Height:kFitH(50) TableView:tableView];
    }else if (indexPath.row==2)
    {
        return [MCCellInfo configForCellId:cell2 Class:[MZLoginCell1 class] Height:kFitH(50) TableView:tableView];
    }else if (indexPath.row==3)
    {
        return [MCCellInfo configForCellId:cell3 Class:[MZLoginCell2 class] Height:kFitH(70) TableView:tableView];
    }else
    {
        return [MCCellInfo configForCellId:cell4 Class:[MZLoginCell3 class] Height:kFitH(35) TableView:tableView];
    }
}
-(id)cellInitForSourceAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==1) {
        return @{@"leftImageName":@"phone_icon",
                 @"placeholder":@"输入手机号"
                 };
    }
    else if(indexPath.row==2) {
        return @{@"leftImageName":@"password_icon",
                 @"placeholder":@"输入密码"
                 };
    }
    else if (indexPath.row==3)
    {
        return @{@"leftImageName":@"",
                 @"placeholder":@"登 陆"
                 };
    }
    return nil;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
